﻿USE Poleposition
GO

IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'up_VendorVisitXMissionStructurePole_SelectIdList')
	DROP PROCEDURE up_VendorVisitXMissionStructurePole_SelectIdList
GO

CREATE PROCEDURE up_VendorVisitXMissionStructurePole_SelectIdList
	 @Vendor_ProjectFK int
	,@SearchByType varchar(50) = null
	,@SearchByText varchar(50) = null
AS

SET NOCOUNT ON	

DECLARE @IdList varchar(MAX)

SELECT 
	 @IdList = @IdList + CONVERT(varchar, [Vendor_Visit_XMissionStructures_PoleId]) + ','
FROM v_tb_Vendor_Visit_XMissionStructures_Poles Pole
INNER JOIN v_tb_Vendor_Visit_XMissionStructures Structure 
	ON Pole.Vendor_Visit_XMissionStructureFK = Structure.Vendor_Visit_XMissionStructureId
WHERE
		Structure.Vendor_ProjectFK = @Vendor_ProjectFK

SELECT @IdList


GO
	
 